<template>
	<view class="contacts_box">
		<view class="header">
			<view class="title">
				名字 {{props.data.name}}
			</view>
			<view class="">
				<uni-icons type="compose" size="30" @click="emits('editFun', {
			id: props.data.id
		})"></uni-icons>
				<uni-icons type="trash" size="30" @click="emits('delFun', {
			id: props.data.id
		})"></uni-icons>

			</view>
		</view>
		<view class="text">
			身份证 {{props.data.idcard}}
		</view>
		<view class="text">
			手机号 {{props.data.tel}}
		</view>
	</view>
</template>

<script setup>
	import {
		ref,
		reactive,
		defineProps,
		defineEmits,
		inject
	} from 'vue';
	const emits = defineEmits(['delFun', 'editFun'])

	const props = defineProps({
		data: {
			type: Object,
			default: () => {}
		}
	})
	// 删除
	const toDel = () => {
		console.log(props.data.id, 'del')
		emits('delFun', {
			id: props.data.id
		})
	}
	// 修改
	const toEdit = () => {
		console.log(props.data.id, 'edit')
		emits('editFun', {
			id: props.data.id
		})
	}
</script>

<style lang="less" scoped>
	.contacts_box {
		width: 100%;
		padding: 20rpx 30rpx;
		box-sizing: border-box;
		border-radius: 10rpx;
		background: #fff;
		margin-top: 20rpx;

		.header {
			display: flex;
			justify-content: space-between;
			align-items: center;

			.title {
				font-size: 40rpx;

			}

		}

		.text {
			color: #888888;

			text {
				padding-left: 10rpx;
				font-weight: 600;
			}
		}
	}
</style>